<?php

namespace Tests\XinSheng;

use PHPUnit\Framework\TestCase;
use XinSheng\Solution;

class TestSolution extends TestCase
{

    public function testGetPlans1()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $plans1 = $solution->getPlans1();
        var_dump($plans1);
        self::assertIsArray($plans1);
    }

    public function testGetOutsideRate1()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $out_irr1 = $solution->getOutsideRate1();
        var_dump($out_irr1);
        self::assertIsFloat($out_irr1);
    }

    public function testGetInsideRate1()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $in_irr1 = $solution->getInsideRate1();
        var_dump($in_irr1);
        self::assertIsFloat($in_irr1);
    }

    public function testGetPlans2()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $plans2 = $solution->getPlans2();
        var_dump($plans2);
        self::assertIsArray($plans2);
    }

    public function testGetOutsideRate2()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $out_irr2 = $solution->getOutsideRate2();
        var_dump($out_irr2);
        self::assertIsFloat($out_irr2);
    }

    public function testGetInsideRate2()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $in_irr2 = $solution->getInsideRate2();
        var_dump($in_irr2);
        self::assertIsFloat($in_irr2);
    }

    public function testGetPlans3()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $solution->set3();
        $plans3 = $solution->getPlans3();
        var_dump($plans3);
        self::assertIsArray($plans3);
    }

    public function testGetInsideRate3()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $solution->set3();
        $in_irr3 = $solution->getInsideRate3();
        var_dump($in_irr3);
        self::assertIsFloat($in_irr3);
    }

    public function testGetPlans4()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $solution->set3();
        $solution->set4(0.5, 0.5, 0.5, 0.5, 0.25, 0.15);
        $plans4 = $solution->getPlans4();
        var_dump($plans4);
        self::assertIsArray($plans4);
    }

    public function testGetOutsideRate4()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $solution->set3();
        $solution->set4(0.5, 0.5, 0.5, 0.5, 0.25, 0.15);
        $out_irr4 = $solution->getOutsideRate4();
        var_dump($out_irr4);
        self::assertIsFloat($out_irr4);
    }

    public function testGetInsideRate4()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $solution->set3();
        $solution->set4(0.5, 0.5, 0.5, 0.5, 0.25, 0.15);
        $in_irr4 = $solution->getInsideRate4();
        var_dump($in_irr4);
        self::assertIsFloat($in_irr4);
    }

    public function testGetPlans5()
    {
        $solution = new Solution(36);
        $solution->set1(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11);
        $solution->set2(0.8, 0.8, 0.8, 0.8, 0.45, 0.08);
        $solution->set3();
        $solution->set4(0.5, 0.5, 0.5, 0.5, 0.25, 0.15);
        $solution->set5();
        $plans5 = $solution->getPlans5();
        var_dump($plans5);
        self::assertIsArray($plans5);
    }
}
